package com.googlecode.loframework.controller
{
	import com.googlecode.loframework.view.IComponent;
	import com.googlecode.loframework.view.components.accessibility.IAccessibility;
	import com.googlecode.loframework.view.components.accessibility.TripleAMediator;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class AccessibilityRegisterMediatorCommand extends SimpleCommand
	{
		public override function execute(notification:INotification):void
		{	
			var component:IComponent = notification.getBody() as IComponent;
			
			if(notification.getBody() as IAccessibility)
			{
				registerAccessibility(component);
			}
			
		}
		
		protected function registerAccessibility(component:IComponent):void
		{
			// register mediator
			var mediator:TripleAMediator = new TripleAMediator(component);
			facade.registerMediator(mediator);
		}
	}
}